<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <style>
         ul li{
            background-color: violet;
            list-style: none;
        }
        .a{
            background-color: red;
            width: 80px;
           
        }
        .b{
            background-color: yellow;
            width: 130px;
            font-size: 30px;
        }
    </style>
    <div id="app">
        <div v-if="isbool" @click="getbtn" :class="{a:aa}">
            安全操作
        </div>
        <div v-else @click="getbtn" :class="{b:bb}">
            危险操作
        </div>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el: "#app",

            data:{
                isbool: false,
                aa: true,
                bb: true,
            },
            methods: {
                getbtn() {
                    this.isbool = !this.isbool
                }
            }
        })
    </script>
</body>

</html>